package com.flower.oauth2.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * @ClassName SysUser
 * @Description 用户类
 * @Date 2021/08/23
 * @Author wuhanxiong
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysUser  implements UserDetails {
    /**
     *id
     */
    private Integer id;
    /**
     * 用户名
     */
    private String username;
    /**
     * 昵称
     */
    private String nickname;
    /**
     * 性别
     */
    private int gender;
    /**
     * 密码
     */
    private String password;
    /**
     * 部门id
     */
    private int deptId;
    /**
     * 软删除标志位,0是未删除,1是已删除
     */
    private int deleted;
    /**
     * 头像
     */
    private String avatar;
    /**
     * 电话
     */
    private String mobile;
    /**
     * 状态,0正常,1禁用
     */
    private int status;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 操作人
     */
    private String operator;
    /**
     * 用户拥有角色
     */
    private List<SysRole> roles;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }
}
